xend: Ensure bootable flag is set in internal xend config for tap
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 1 May 2007 09:15:08 +0000 (10:15 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 1 May 2007 09:15:08 +0000 (10:15 +0100)
devices.

Original patch by: Jim Fehlig <jfehlig@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/python/xen/xend/XendConfig.py

index 6ced067f7b4ef0704b30e0743122dffae63772be..14e0444df8533c4854040efff4d6b9087bdf287a 100644 (file)
@@ -988,19 +988,16 @@ class XendConfig(dict):
                 if param not in target:
                     target[param] = []
                 if dev_uuid not in target[param]:
-                    if dev_type == 'vbd' and not target[param]:
-                        # Compat hack -- this is the first disk, so mark it
-                        # bootable.
-                        dev_info['bootable'] = 1
+                    if dev_type == 'vbd':
+                        # Compat hack -- mark first disk bootable
+                        dev_info['bootable'] = int(not target[param])
                     target[param].append(dev_uuid)
             elif dev_type == 'tap':
                 if 'vbd_refs' not in target:
                     target['vbd_refs'] = []
                 if dev_uuid not in target['vbd_refs']:
-                    if not target['vbd_refs']:
-                        # Compat hack -- this is the first disk, so mark it
-                        # bootable.
-                        dev_info['bootable'] = 1
+                    # Compat hack -- mark first disk bootable
+                    dev_info['bootable'] = int(not target['vbd_refs'])
                     target['vbd_refs'].append(dev_uuid)
                     
             elif dev_type == 'vfb':